import axios from 'axios';
import * as uuid from 'uuid';
export default async function updateoss(files: File[], res: any) {
    const x = files[0].name.split(".");
    const url = `app/base/${uuid.v4()}/${files[0].name}`;
    const f = new FormData
    f.append('key', url)
    f.append('OSSAccessKeyId', res.OSSAccessKeyId)
    f.append('policy', res.policy)
    f.append('signature', res.signature)
    f.append('file', files[0])

    await axios.post(res.host, f)
    return res.host + '/' + url

}